<?php

namespace app\fkshou\command;


use app\fkshou\common\Jwts;
use think\console\Command;
use think\console\Input;
use think\console\Output;



class jwt extends Command
{

    protected $output;

    protected $input;

    protected function configure()
    {
        // 指令配置
        $this->setName('jwt')->setDescription('方块兽');
    }

    protected function execute(Input $input, Output $output)
    {
        // 指令输出
        $this->input = $input;

        $this->output = $output;

        try {
            $this->go();
        } catch (\Throwable $th) {
            dump($th->getMessage());
            dump($th->getTraceAsString());
        }
    }

    function go()
    {
        $this->output->writeln('开始执行');
        $jwt = Jwts::getInstance()->Create([
            'CpuId' => "234567",
            'register' => "1,2",
            'wx_id' => "76345345",
            'phone' => "1567654567",
            'create_time' => time(),
            'auth_hash' => md5(1567654567)
        ]);

        $this->output->writeln($jwt);
        $data = Jwts::getInstance()->CheckJwt('cXdlZXJmdnhtaWpqcnRpYWZoODk5MjVeQCojJCpleUpoYkdjaU9pSlNVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKQlpHMXBiaUk2ZEhKMVpTd2lRM0IxU1dRaU9pSmlNbUUzWkRNeFpERTBaVFZrTVRrd09XSmtaRGc0T1RJeE1HWm1NbVV3TmlJc0lrbHpjM1ZsWkVGMElqb3hOekUyT1RnNU1EUTBMQ0pWYzJWeUlqb2lZV1J0YVc0aWZRLk1KdFlZNUExbFNtekJzVkdVZ0dLT2ZqQnhTX1d5VWdzaXdXVmFaVURJN1p0VkpoX3NNam55a280bzktODFfWUk0U1V2SGZrTjNaTEJDT2tselJaUWNHVlktUkJoeFNlZGhOUXQ0TzVnVDJDMEZySWhBSG5GTXVuY2k2eW9zd0RUdTgzRDhITFdFbTh1UkpSZEZrRExHcVNxbHQyUl9UOU5VRHp0MVNqMlYzTWFzZGZnanRpcjV5aHlka15AKnIjJGFlYXJncmRnMzMq');
        dump($data);
        $jwt = Jwts::getInstance()->Create($data);
        dump($jwt);

    }
}


